<?php
	$listPrices = $this->requestAction('/prices/listPrices');
		$topNewsHome = $this->requestAction('/comment/topNewsHome');
?>
<div class="home_cat">
<?php if($this->Session->check('IdMember')==1)  { ?>
	<p class="p_home_cat">Quản lý tài khoản</p>
	<div class="list_catHome" style="padding: 7px;">
		<?php echo $this->Html->link("Thông tin tài khoản", array('controller' => 'members','action'=>'index'), array('escape' => false,'class'=>'a_catHome','style'=>''));?>
			<a class="a_dotCat"></a>
		<?php echo $this->Html->link("Giỏ hàng của bạn", array('controller' => 'products','action'=>'viewcart'), array('escape' => false,'class'=>'a_catHome','style'=>''));?>
			<a class="a_dotCat"></a>
		<?php echo $this->Html->link("Đổi mật khẩu", array('controller' => 'members','action'=>'changepass'), array('escape' => false,'class'=>'a_catHome','style'=>''));?>
			<a class="a_dotCat"></a>
		<a href="<?php echo DOMAIN;?>/members/logout" class="a_catHome" style="">Thoát</a>
	
	</div>
<?php } else { ?>
	<p class="p_home_cat">Đăng nhập</p>
	<div class="list_catHome" style="padding: 7px;">
		<form action="<?php echo DOMAIN;?>/members/login" method="POST">
			<p class="text_login">Email đăng nhập</p>
			<input type="email" class="txtdn_email" id="email" name="data[Member][email]"  placeholder=" Email đăng nhập"  required="">
			<p class="text_login">Mật khẩu</p>
			<input type="password" class="txtdn_email" id="password" name="data[Member][pass]"  placeholder=" Mật khẩu"  required=""><br />
			<p style="margin-right: 8px;margin-bottom: 5px;text-align: right;">
				<a href="<?php echo DOMAIN;?>/dang-ky.html">Đăng ký | </a>
				<!--a href="<?php echo DOMAIN;?>/quen-mat-khau.html">Quên mật khẩu</a-->
			</p>
			<p style="width: 97%;height: 30px;text-align: right;"><input type="submit" id="SendSearch" class="sb_search_right" value="Đăng nhập" style="margin-top: 7px;"></p>
		</form>
	</div>
<?php } ?>		
</div><!--End .home_cat-->
<!--------------------------------------------------------------------------------->				

<div class="home_cat">
	<p class="p_home_cat">Tìm kiếm</p>
	<div class="list_catHome" style="padding: 7px;">
	<form action="<?php echo DOMAIN;?>/tim-kiem.html" method="post" style="">
		<p class="text_search">Từ khóa</p>
		<input type="text" class="txt_search" id="txt_search" name="txt_search"  placeholder=" Từ khóa"  required="">
		<p class="text_search">Chọn giá: VNĐ</p>
		<input type="text" class="txt_search_from" id="txt_search_from" name="priceT"  placeholder=" Từ "  required="">
		<input type="text" class="txt_search_to" id="txt_search_to" name="priceS"  placeholder=" Đến "  required="">
		<p style="width: 97%;height: 30px;text-align: right;"><input type="submit" id="SendSearch" class="sb_search_right" value="Tìm kiếm" style="margin-top: 7px;"></p>
	</form>	
	</div>
</div><!--End .home_cat-->
<!--------------------------------------------------------------------------------->				

<!--------------------------------------------------------------------------------->				

<div class="home_cat">
	<p class="p_home_cat">Báo giá</p>
	<div class="list_catHome" style="padding: 7px;">
	
	<div class="list_price">
		<?php 
			$n=count($listPrices);
			foreach($listPrices as $key=>$listPrices)
		{?>
			<a  target="_blank" href="<?php echo DOMAIN."/".$listPrices['Price']['url']?>" class="a_rprices"><?php echo $listPrices['Price']['name']?></a>
			<?php if($n!=$key){?><a class="a_dotCat" style="margin: 0px;"></a><?php } ?>
		<?php } ?>
	</div>

	</div>
</div><!--End bao gia.home_cat-->

<!-------------------------------------------------------------------------------->
<div class="home_cat">
	<p class="p_home_cat">Tin tức cập nhật</p>
	<div class="list_catHome">
		<?php 
			$n=count($topNewsHome)-1;
			foreach($topNewsHome as $keyy=>$topNewsHome) 
		{?>
			<?php
				$name=$this->Text->truncate(strip_tags($topNewsHome['News']['name']), 50,array(  'ending' => '...', 'exact' => false,'html' => true ));; 
				echo $this->Html->link($name, array('controller' => 'news','action'=>'views',$topNewsHome['News']['id'],$topNewsHome['News']['alias'].'.html'), array('escape' => false,'title'=>$topNewsHome['News']['name'],'class'=>'a_newsHome'));?>
			<?php  if($n!=$keyy) {?>
			<a class="a_dotNews"></a>
		<?php }} ?>	
	</div>
</div><!--End .home_cat-->
<!--------------------------------------------------------------------------------->				
